#include <stdio.h>

#include "SocketUtils.h"
#include "Log.h"

int	main(int argc, char **argv) {
    int socket;
    char buffer[100] = {0};
    char value[100] = "123456";
    TcpSocketServer tcp = {0};
    TcpSocket client = {0};

    if (createTcpSocketServer(&tcp, 8080)) {
        WARNING_LOG("创建成功");
        if (socketAccept(&tcp, &client)) {
            int len = tcpSocketWrite(&client, value, sizeof(value));
            INFO_LOG("send: len: %d: %s", len, value);
            len = tcpSocketRead(&client, buffer, 10);
            INFO_LOG("receiver: len: %d: %s", len, buffer);
        }
    } else {
        WARNING_LOG("创建失败");
    }
    return 0;
}